<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ include file="/common/taglibs.jsp"%>
<script type="text/javascript" charset="utf-8" src="${ctx}/editor/kindeditor-min.js"></script>
<link rel="stylesheet" type="text/css" href="${ctx}/styles/bbs.css" media="screen"/>
<div class="dirbar">
	<a href="<c:url value='/home.do'/>"><span>首页</span></a>
	&nbsp;&gt;&gt;&nbsp;<a href="<c:url value='/team/list.do'/>"><span>群组</span></a>
	&nbsp;&gt;&gt;&nbsp;<a href="<c:url value='/team/index.do?teamid=${team.teamid}'/>"><span>${team.name}</span></a>
	&nbsp;&gt;&gt;&nbsp;发表新话题
</div>	
<div class="ntopic">
	<div class="ntopic_auther">
		<span>作&nbsp;&nbsp;者:</span><c:out value="${nickname}"></c:out>
	</div>
	<form id="f_new_teamtopic" action="<c:url value='/team/savettopic.do'/>" method="POST" >
		<input type="hidden" name="teamid" value="${team.teamid}"/>
		<span>标&nbsp;&nbsp;题:</span>
		<input id="teamtopic_title" name="title" value="${title}" size="40" class="input"/>
		&nbsp;&nbsp;
		<select name="original" size="1" class="input">
			<option value="2" <c:if test="${original == 2}">selected="selected"</c:if>>原创</option>
			<option value="1" <c:if test="${original == 1}">selected="selected"</c:if>>转载</option>
		</select>
		&nbsp;&nbsp;
		
		<input type="checkbox" id="i_share_public" name="sharePublic" value="1"/>共享到社区
		<script type="text/javascript">
			var sharePublic = "<c:out value='${sharePublic}' />";
			var sharePublicValue = parseInt(sharePublic);
			if(sharePublicValue == 1){
				$("#i_share_public").attr("checked",true);
		  	}
		</script>
		<select name="sharedBoardId" size="1" class="input">
			<option value="12" <c:if test="${sharedBoardId == 12}">selected="selected"</c:if>>大杂烩</option>
			<option value="13" <c:if test="${sharedBoardId == 13}">selected="selected"</c:if>>经济</option>
			<option value="14" <c:if test="${sharedBoardId == 14}">selected="selected"</c:if>>游记</option>
			<option value="18" <c:if test="${sharedBoardId == 18}">selected="selected"</c:if>>千山</option>
			<option value="19" <c:if test="${sharedBoardId == 19}">selected="selected"</c:if>>千水</option>
		</select>
		<input type="checkbox" id="i_share_team" name="shareTeam" value="1"/>共享给联盟组
		<script type="text/javascript">
			var shareTeam = "<c:out value='${shareTeam}' />";
			var shareTeamValue = parseInt(shareTeam);
			if(shareTeamValue == 1){
				$("#i_share_team").attr("checked",true);
		  	}
		</script>
		<br/>
		<span>内&nbsp;&nbsp;容:</span>
		<br/>
		<c:if test="${not empty message}">
			<div id="div_teamtopic_error" class="div_topic_error" style="display:block"><c:out value="${message}"/></div>
		</c:if>
		<textarea id="teamtopic_content" name="content" rows="200" cols="80" style="width:750px;height:400px"><c:out value='${content}'/></textarea>
		<br/>
		<button class="btn1" type="submit" name="submitTopic">发表</button>
	</form>
</div>
<script type="text/javascript">
KE.show({
	id : 'teamtopic_content',
	imageUploadJson : ctx+'/h/keditor.do',
	fileManagerJson : ctx + '/editor/jsp/file_manager_json.jsp',
	allowFileManager : true,
	afterCreate : function(id) {
		KE.event.ctrl(document, 13, function() {
			KE.util.setData(id);
			document.forms['teamtopic_content'].submit();
		});
		KE.event.ctrl(KE.g[id].iframeDoc, 13, function() {
			KE.util.setData(id);
			document.forms['teamtopic_content'].submit();
		});
	}
});
</script>